#include <stdio.h>
#include <math.h>
int judgement(int);
int main(void)
{
	int number, min, a, b;
	min = 100;
	number = 999;
	for (b=0; min <= number; min++)
	{
		a = judgement(min);
		if (a == 1)
		{
			printf("  %d  ", min);
			b++;
			if (b % 5 == 0)printf("\n");
		}
		
	}
	return 0;


    }










int judgement(int n)
{
	int i, k, judge;
	i = 2;
	judge = 1;
	k = (int)sqrt(n);
	for (; i <= k; i++)
	{
		if(n%i==0)
		{
			judge =0;
			break;
		}
	}
	return judge;

}